Roll-Up Summary Fields
A roll-up summary field calculates values from related records, such as those in a related list. You can create a roll-up summary field to display a value in a master record based on the values of fields in a detail record. The detail record must be related to the master through a master-detail relationship. For example, you want to display the sum of invoice amounts for all related invoice custom object records in an account’s Invoices related list. You can display this total in a custom account field called Total Invoice Amount.
Steps to Create a Roll-Up Summary Field:
- Create a custom field on the object where you want the field displayed. Summary fields summarize the values from records on a related object, so the object on which you create the field should be on the master side of a master-detail relationship. For instructions on creating a custom field, see Create Custom Fields.
- Choose the Roll-Up Summary field type, and click Next.
- Enter a field label and any other attributes. Click Next.
- Select the object on the detail side of a master-detail relationship. This object contains the records you want to summarize.
Select the type of summary:
TYPE | DESCRIPTION |
---|---|
COUNT | Totals the number of related records. |
SUM | Totals the values in the field you select in the Field to Aggregate option. Only number, currency, and percent fields are available. |
MIN | Displays the lowest value of the field you select in the Field to Aggregate option for all directly related records. Only number, currency, percent, date, and date/time fields are available. |
MAX | Displays the highest value of the field you select in the Field to Aggregate option for all directly related records. Only number, currency, percent, date, and date/time fields are available. |
- Enter your filter criteria if you want a selected group of records in your summary calculation. If your organization uses multiple languages, enter filter values in your organization's default language.
- When you use picklists to specify filter criteria, the selected values are stored in the organization's default language. If you edit or clone existing filter criteria, first set the Default Language on the Company Information page to the same language that was used to set the original filter criteria. Otherwise, the filter criteria may not be evaluated as expected.
- Click Next.
- Set the field-level security to determine whether the field should be visible for specific profiles, and click Next.
- Choose the page layouts that should display the field. The field is added as the last field in the first two-column section on the page layout. For user custom fields, the field is automatically added to the bottom of the user detail page.
- Click Save to finish or Save & New to create more custom fields.
Limitations on Roll-Up Summary Fields in Salesforce:
- A Roll-up summary can be created only on records which are having Master-Detail Relationship
- Only 40 roll-up summary fields can be created for an object
- Long text area, multi-select picklist, Description fields, system fields like Last Activity, cross-object formula fields, and lookup fields can’t be used in roll-up summary filters
- A Master-detail relationship can’t be changed to lookup relationship after creating a roll-up summary field on an object
- When you refer to a roll-up summary field in a list view or report, you can’t use certain qualifiers, including: Starts with Contains, Does not contain, Includes, Excludes and Within.
Implementation Tips:
- Create roll-up summary fields on:
- Any custom object that is on the master side of a master-detail relationship
- Any standard object that is on the master side of a master-detail relationship with a custom object
- Opportunities using the values of opportunity products related to the opportunity
- Accounts using the values of related opportunities
- Campaigns using campaign member status or the values of campaign member custom fields
- The types of fields you can calculate in a roll-up summary field depend on the type of calculation. For example,
- Number, currency, and percent fields are available when you select SUM as the roll-up type.
- Number, currency, percent, date, and date/time fields are available when you select MIN or MAX as the roll-up type.
- Sometimes you can’t change the field type of a field that you reference in a roll-up summary field.
- Make sure that the filter for your roll-up summary doesn't encounter a formula field that results in “#Error!”. If one of your filter criteria uses a formula field that results in an error, no matches are returned for that filter criterion. For example, your roll-up summary filter is “Formula Field equals 10”. Two records contain errors, and one contains the value “10” in that field. In this case, your summary includes only the record with the value “10.”
- Salesforce does not recalculate the value of campaign roll-up summary fields when leads or contacts are deleted. Select the Force a mass recalculation of this field option on the edit page of the roll-up summary field to manually recalculate the value.
- You can’t use long text area, multi-select picklist, Description fields, system fields like Last Activity, cross-object formula fields, and lookup fields in the field column of roll-up summary filters.
- Auto number fields are not available as the field to aggregate in a roll-up summary field.
- After you have created a roll-up summary field on an object, you cannot convert the object's master-detail relationship into a lookup relationship.
- Roll-up summary fields are not available for mapping lead fields of converted leads.
Notes:
Roll up Summary Fields
- To create one, you need Master-Detail Relationship
- Once created, you cannot change the detail object selected or delete any field referenced in your roll-up summary definition.
- Because roll-up summary fields are not displayed on edit pages, you can use them in validation rules.
- Validation errors can display when saving either the detail or master record.
- Automatically derived fields, such as current date or the current user, are NOT allowed in a roll-up summary field.
Resources:
# Rollup Summary Field
Comments
Post a Comment